package cn.yudao.ymcc.feign;


import cn.yudao.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class CourseFeignFallbackFactory implements FallbackFactory<CourseFeign> {


    @Override
    public CourseFeign create(Throwable throwable) {
        return new CourseFeign() {
            @Override
            public JSONResult getCourseByIds(List<Long> ids) {
                throwable.printStackTrace();
                return JSONResult.error("网络波动异常");
            }
        };
    }
}
